﻿
using System.Collections.Generic;

namespace GDFlacTool.Common
{
    public class MaskHelperCollection : List<MaskHelper>
    {
        private string _mask = string.Empty;

        public MaskHelperCollection()
        {
            Init();
        }

        public string Mask
        {
            get { return _mask; }
            set { _mask = value; }
        }

        private void Init()
        {
            Add(new MaskHelper("%1", "<Artist>", MaskType.ARTIST, true));
            Add(new MaskHelper("%2", "<Title>", MaskType.TITLE, true));
            Add(new MaskHelper("%3", "<Album>", MaskType.ALBUM, true));
            Add(new MaskHelper("%4", "<Year>", MaskType.DATE, true));
            Add(new MaskHelper("%5", "<Genre>", MaskType.GENRE, true));
            Add(new MaskHelper("%6", "<Track #>", MaskType.TRACKNUMBER, true));
            Add(new MaskHelper("%T", "<Track 0#>", MaskType.TRACKNUMBERZERO, true));
            Add(new MaskHelper("%C", "<Comment>", MaskType.COMMENT, true));
            Add(new MaskHelper("%8", "<File Name>", MaskType.FILENAME, false));
            Add(new MaskHelper("%9", "<File Number>", MaskType.FILENUMBER, false));
            Add(new MaskHelper("%0", "<Bitrate>", MaskType.BITRATE, false));
            Add(new MaskHelper("%P", "<Play Time>", MaskType.PLAYTIME, false));
            Add(new MaskHelper("%B", "<BPM>", MaskType.BPM, false));
            Add(new MaskHelper("%M", "<Composer>", MaskType.COMPOSER, true));
            Add(new MaskHelper("%A", "<Album Artist>", MaskType.ALBUMARTIST, true));
            Add(new MaskHelper("%N", "<Conductor>", MaskType.CONDUCTOR, true));
            Add(new MaskHelper("%7", "<Disc #>", MaskType.DISCNUMBER, true));
            Add(new MaskHelper("%D", "<Disc 0#>", MaskType.DISCNUMBERZERO, true));
            Add(new MaskHelper("%G", "<Catalog>", MaskType.LABELNO, true));
            Add(new MaskHelper("%O", "<Mood>", MaskType.MOOD, true));
            Add(new MaskHelper("%L", "<Label>", MaskType.LABEL, true));
            Add(new MaskHelper("%R", "<Remixed By>", MaskType.VERSION, true));
            Add(new MaskHelper("%Q", "<Quality>", MaskType.QUALITY, true));
            Add(new MaskHelper("%E", "<Encoder>", MaskType.ENCODER, false));
            Add(new MaskHelper("%E", "<Encoder>", MaskType.ENCODER, false));
            Add(new MaskHelper("%X", "<Extension>", MaskType.EXTENSION, false));
        }
    }

    public enum MaskType
    {
        ARTIST = 1,
        TITLE = 2,
        ALBUM = 3,
        DATE = 4,
        GENRE = 5,
        TRACKNUMBER = 6,
        TRACKNUMBERZERO = 7,
        COMMENT = 8,
        FILENAME = 9,
        FILENUMBER = 10,
        BITRATE = 11,
        PLAYTIME = 12,
        BPM = 13,
        COMPOSER = 14,
        ALBUMARTIST = 15,
        CONDUCTOR = 16,
        DISCNUMBER = 17,
        DISCNUMBERZERO = 18,
        LABELNO = 19,
        MOOD = 20,
        LABEL = 21,
        VERSION = 22,
        QUALITY = 23,
        ENCODER = 24,
        EXTENSION = 25
    }

    public enum RenameType
    {
        FILENAME = 0,
        TAGFROMFILE = 1,
        FOLDERRENAME = 2
    }
}
